package com.eastfair.common.controller.othertomice;

import com.alibaba.fastjson.JSONObject;
import com.eastfair.certificate.api.CertificateApiFeign;
import com.eastfair.common.vo.CarInOffRecord;
import com.eastfair.core.base.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassNameRoadGateController
 * @Description 道闸
 * @Authoradmin
 * @Date 2023/1/6 17:21
 * @Version 1.0
 **/
@Slf4j
@Validated
@RestController
@RequestMapping("/roadGate")
public class RoadGateController {
    @Resource
    private CertificateApiFeign certificateApiFeign;

    /**
     * @Author clm
     * @Description //同步进出场记录
     * @Date 17:50 2023/1/6
     * @Param [carInOffRecord]
     * @return com.eastfair.core.base.R<java.lang.Boolean>
     **/
    @PostMapping("/inOff/sync")
    public R<Boolean> syncInOffRecord(@RequestBody CarInOffRecord carInOffRecord){

        log.info("syncInOffRecord:{}", JSONObject.toJSONString(carInOffRecord));
        certificateApiFeign.sycnCarOff(carInOffRecord);

        return R.success();
    }
}
